﻿using SqlSugar;
using Zhp.Entity.Design;
using Zhp.Model.Common;

namespace Zhp.Model.Design
{
    public class DesignInstanceModel
    {
        /// <summary>
        /// 列表配置
        /// </summary>
        public DesignListConfig ListConfig { get; set; }
        /// <summary>
        /// 表格配置
        /// </summary>
        public string TableConfig { get; set; }

        public DesignInstanceFormSetting FormSetting { get; set; }
    }

    /// <summary>
    /// 表单配置
    /// </summary>
    public class DesignInstanceFormSetting
    {
        /// <summary>
        /// 表单Id
        /// </summary>
        public long Id { get; set; }
        /// <summary>
        /// 表单名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 表单数据源
        /// </summary>
        public string SourceCode { get; set; }
        /// <summary>
        /// 表单配置
        /// </summary>
        public string FormConfig { get; set; }
        /// <summary>
        /// 表单字段
        /// </summary>
        public string FormItemList { get; set; }
        /// <summary>
        /// 表单样式
        /// </summary>
        public string FormStyle { get; set; }
    }

    public class DesignInstanceQuery : PageModel
    {
        public List<DesignQuerySearch> Query { get; set; }
        public SortParam[] Sorts { get; set; }
        public long ListId { get; set; }
    }

    public class DesignQuerySearch
    {
        public string FieldName { get; set; }
        public object FieldValue { get; set; }
    }

    public class DesignInstanceEdit
    {
        /// <summary>
        /// 表单ID
        /// </summary>
        public long FormId { get; set; }

        /// <summary>
        /// 表单数据
        /// </summary>
        public string FormData { get; set; }
    }
}
